package com.zboin.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author zhboom
 * @date 2025/5/9 22:32
 */
@Data
@TableName("article")
public class Article implements Serializable {

    @Serial
    private static final long serialVersionUID = 20250517155608L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField
    private String title;

    @TableField
    private String description;

    @TableField
    private String author;

    @TableField("image_url")
    private String imageUrl;

    @TableField
    private String content;

    @TableField
    private String url;

    @TableField
    private String type;

    @TableField
    private String tags;

    @TableField("create_date")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    @TableField("update_date")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    @TableLogic
    @JSONField(serialize = false)
    private Integer isValid;
}
